﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Domain.Entity;
using FluentNHibernate.Mapping;


namespace PropertyManagement.Domain.Mapping.FluentHibernate
{
    public class CustomerMap : ClassMap<Customer>
    {
        public CustomerMap()
        {
            Table("Customer");
            Id(x => x.ID).Column("ID").GeneratedBy.Identity();
            References(x => x.Title).Column("TitleID");
            Map(x => x.FirstName).Column("FirstName");
            Map(x => x.LastName).Column("LastName");
            //Map(x => x.MiddleName).Column("MiddleName");
            Map(x => x.CompanyName).Column("CompanyName");
            //Map(x => x.Sex).Column("Sex");
            //Map(x => x.DOB).Column("DOB");
            Map(x => x.AddressLine1).Column("AddressLine1");
            Map(x => x.AddressLine2).Column("AddressLine2");
            Map(x => x.AddressLine3).Column("AddressLine3");
            Map(x => x.City).Column("City");
            Map(x => x.County).Column("County");
            References(x => x.Country).Column("CountryID");
            Map(x => x.Postcode).Column("Postcode");
            Map(x => x.Email).Column("Email");
            //Map(x => x.HomePhone).Column("HomePhone");
            //Map(x => x.MobileNo).Column("MobileNo");
            //Map(x => x.WorkPhoneNo).Column("WorkPhoneNo");
            //Map(x => x.FaxNo).Column("FaxNo");
            Map(x => x.CreatedBy).Column("CreatedBy");
            Map(x => x.CreatedDate).Column("CreatedDate");
            Map(x => x.UpdatedBy).Column("UpdatedBy");
            Map(x => x.UpdatedDate).Column("UpdatedDate");
            Map(x => x.IsDeleted).Column("IsDeleted");
        }
    }
}
